package entity.innerClass.lianxi.demo04;
import java.util.function.Supplier;

public class MainTest {
    public static void main(String[] args) {
        Students stu01 = new Students("来了",14);
        Students stu02 = new Students("小妹",28);
        Students stu03 = new Students("灭那个",29);
        Students stu04 = new Students("阿斯顿",24);
        Students[] stu = {stu01,stu02,stu03,stu04};
        Supplier<Students> supplier = () ->{
            Students min = stu[0];
            for (Students students : stu){
                if(min.getAge() > students.getAge()){
                    min = students;
                };
            }
            return min;
        };
        System.out.println(supplier.get());
    }
}
